home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Graphics Programming (2nd Edition) / Visual Basic Graphics Programming 2nd Edition.iso / OldSrc / CH1 / SRC / IMAGEPIC.FRM < prev    next >
Text File  |  1995-12-15  |  3KB  |  118 lines

  1. VERSION 4.00
  2. Begin VB.Form ImagePicForm 
  3.    Caption         =   "The Image and Picture Properties"
  4.    ClientHeight    =   3705
  5.    ClientLeft      =   1605
  6.    ClientTop       =   1425
  7.    ClientWidth     =   6150
  8.    Height          =   4395
  9.    Left            =   1545
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   3705
  12.    ScaleWidth      =   6150
  13.    Top             =   795
  14.    Width           =   6270
  15.    Begin VB.CommandButton CmdClear 
  16.       Caption         =   "Clear"
  17.       Height          =   495
  18.       Index           =   2
  19.       Left            =   4560
  20.       TabIndex        =   4
  21.       Top             =   3120
  22.       Width           =   855
  23.    End
  24.    Begin VB.CommandButton CmdClear 
  25.       Caption         =   "Clear"
  26.       Height          =   495
  27.       Index           =   1
  28.       Left            =   720
  29.       TabIndex        =   3
  30.       Top             =   3120
  31.       Width           =   855
  32.    End
  33.    Begin VB.CommandButton CmdCopy 
  34.       Caption         =   "Copy"
  35.       Height          =   495
  36.       Left            =   2640
  37.       TabIndex        =   2
  38.       Top             =   3120
  39.       Width           =   855
  40.    End
  41.    Begin VB.PictureBox Pict 
  42.       Height          =   3015
  43.       Index           =   2
  44.       Left            =   3120
  45.       ScaleHeight     =   2955
  46.       ScaleWidth      =   2955
  47.       TabIndex        =   1
  48.       Top             =   0
  49.       Width           =   3015
  50.    End
  51.    Begin VB.PictureBox Pict 
  52.       AutoRedraw      =   -1  'True
  53.       Height          =   3015
  54.       Index           =   1
  55.       Left            =   0
  56.       ScaleHeight     =   2955
  57.       ScaleWidth      =   2955
  58.       TabIndex        =   0
  59.       Top             =   0
  60.       Width           =   3015
  61.    End
  62.    Begin VB.Menu mnuFile 
  63.       Caption         =   "&File"
  64.       Begin VB.Menu mnuFileExit 
  65.          Caption         =   "E&xit"
  66.       End
  67.    End
  68. End
  69. Attribute VB_Name = "ImagePicForm"
  70. Attribute VB_Creatable = False
  71. Attribute VB_Exposed = False
  72. Option Explicit
  73.  
  74. Dim DrawingIndex As Integer
  75. Dim LastX As Single
  76. Dim LastY As Single
  77.  
  78.  
  79. Private Sub CmdClear_Click(Index As Integer)
  80.     Pict(Index).Cls
  81. End Sub
  82.  
  83.  
  84. Private Sub CmdCopy_Click()
  85.     Pict(2).Picture = Pict(1).Image
  86. End Sub
  87.  
  88.  
  89.  
  90. Private Sub mnuFileExit_Click()
  91.     Unload Me
  92. End Sub
  93.  
  94. Private Sub Pict_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  95.     DrawingIndex = Index
  96.     Pict(Index).CurrentX = X
  97.     Pict(Index).CurrentY = Y
  98.     LastX = X
  99.     LastY = Y
  100. End Sub
  101.  
  102.  
  103. Private Sub Pict_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  104.     If DrawingIndex <> Index Then Exit Sub
  105.     Pict(Index).Line -(X, Y)
  106.     LastX = X
  107.     LastY = Y
  108. End Sub
  109.  
  110.  
  111. Private Sub Pict_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  112.     If DrawingIndex <> Index Then Exit Sub
  113.     DrawingIndex = 0
  114.     Pict(Index).Line -(X, Y)
  115. End Sub
  116.  
  117.  
  118.